package com.mz.ozy.mvp.presenter;

import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.HotSearchBean;
import com.mz.ozy.mvp.model.HotSearchModel;
import com.mz.ozy.mvp.view.HotSearchContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by Administrator on 2018/12/11.
 */

public class HotSearchPresenter extends BasePresenterImpl<HotSearchContract.View> implements HotSearchContract.Presenter {

    private HotSearchModel mModel;

    public HotSearchPresenter() {
        super();
        mModel = new HotSearchModel();

    }

    @Override
    public void onHotSearch(Activity activity) {
        mModel.onHotSearch(activity)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<HotSearchBean>(mView) {
                    @Override
                    public void onSuccesss(HotSearchBean hotSearchBean) {
                        mView.onHotSearchSuccess(hotSearchBean);

                    }
                });

    }


}
